/**
 * 
 */
package org.gocom.components.conframe.util;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.alibaba.fastjson.JSONArray;
import com.eos.system.annotation.Bizlet;

/**
 * @author Chongbao.Mo
 * @date 2016-09-21 11:15:15
 *
 */
@Bizlet("")
public class ToJsonArray {

	
	
	@Bizlet("")
	public static List<String[] > toJsonArray(String str){
		JSONArray arr=JSONUtil.toJSONArray(str);
		
		List<String[] > relist=new ArrayList<String []>();
		for(Object obj:arr){
			JSONArray over=JSONUtil.toJSONArray(obj.toString());
			
			List<String> stringList=new ArrayList<String>();
			Iterator<Object> it=over.iterator();
			while(it.hasNext()){
				Object st11=it.next();
				String st12=(st11!=null ? st11:"").toString();
				stringList.add(st12);
			}
			String[] st=new String[stringList.size()];
			relist.add(stringList.toArray(st));
		}
		
		return relist;
	}
	@Bizlet("")
	public static String[]  toJsonArrayString(String str){
			JSONArray arr=JSONUtil.toJSONArray(str);
			List<String> stringList=new ArrayList<String>();
			Iterator<Object> it=arr.iterator();
			while(it.hasNext()){
				stringList.add(it.next().toString());
			}
			String [] relist=new String[stringList.size()];
			relist=stringList.toArray(relist);
		
		return relist;
	}
}
